<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title></title>
	</head>
	<body>
		<img src="img/1.jpg" id="imgId" ><br />
		<button type="button" onclick="doAction();">开始</button>
	</body>
	<script type="text/javascript">
	function doAction(){
		var imgObj=document.getElementById('imgId');
		var num=0;
		setInterval(
		function(){
			if(num==9){
				num=0;
			}
			num++;
			imgObj.src='img/'+num+'.jpg';
		},1000
		)
	}
	</script>
</html>
